
#pragma once

/*-----------------------------------------------------------------------------
 * HEADER FILES
 *---------------------------------------------------------------------------*/
#include <stdint.h>

#include "gmi_status.h"

/*-----------------------------------------------------------------------------
 * ENUM
 *---------------------------------------------------------------------------*/
typedef enum register_width_e
{
    REGISTER_8_BIT = 0,
    REGISTER_16_BIT,
    REGISTER_24_BIT,
    REGISTER_32_BIT,
} gmi_reg_width_t;

typedef struct i2c_slave_configuration_st
{
    void* phandle;
    const char* device_tag;
    uint8_t device_id;
    gmi_reg_width_t reg_width;
} gmi_i2c_slave_config_t;

/*-----------------------------------------------------------------------------
 * FUNCTIONS DECLARATION
 *---------------------------------------------------------------------------*/

GMI_STATUS gmi_i2c_master_write_read(gmi_i2c_slave_config_t* slave,
                                     uint8_t* write_buffer,
                                     size_t write_size,
                                     uint8_t* read_buffer,
                                     size_t read_size);